<style type="text/css">
.company-form{
    float: left;
    border: 5px solid #C6C8C6;
    border-radius: 8px 8px 8px 8px;
    padding: 15px;
    width: 500px;        
}

div.form-wrapper {
    clear: both;
    overflow: auto;
}
div.form-label{
    clear: left;
    color: #777777;
    float: left;
    font-size: 0.9em;
    font-weight: bold;
    margin-bottom: 10px;
    overflow: hidden;
    padding: 4px 15px 0 2px;
    text-align: right;
    width: 150px;
}
div.form-element {
    clear: none;
    float: left;
    margin-bottom: 10px;
    max-width: 600px;
    min-width: 150px;
    overflow: hidden;
    text-align: left;
}
#fieldset-buttons {
    text-align: left;    
    margin-left: 163px;           
}
p.company_link{
    padding: 4px 15px 0 2px;
    width: 200px;    
}
p.company_link img{
    padding-right: 10px;
}

p.company_link.active,p.company_link:hover{
    background: #ECEFF5; 
    cursor: pointer;
}
p.company_link.active{
    padding-left: 15px;
}

p.company_link.create{
    color: #777777;    
    font-size: 0.9em;
    font-weight: bold;
    padding-left: 15px;    
}

#link.readonly{
     background:#f2f2f2; 
     color:#999; 
     border:1px solid #999;    
}

#hints{
    margin: 0 5px 10px 165px;
}
#hints p{
    padding-bottom: 0;
}

#image_upload{
    margin-left: 165px;
    margin-bottom: 15px;    
}
#image_upload.disabled{
    background: none repeat scroll 0 0 #F2F2F2;
    color: #111111;
}

#image{
    background: no-repeat scroll center center;
    float: left;  
    margin-left: 10px;
    /*margin-top: 40px;*/
    width: 100px;
    height: 100px;
    border: 1px solid #C6C8C6;
    border-radius: 8px 8px 8px 8px;
    z-index: 99;
}
#country_id-element{
	position: relative;
}
</style>
<div class="company-form">
<?php //echo $this->form->render($this) ?>

<!-- <div id="image"></div>-->
<form id="<?php echo $this->form->getAttrib('id');?>" name="<?php echo $this->form->getAttrib('name');?>" enctype="multipart/form-data" action="<?php echo $this->escape($this->form->getAction()) ?>" method="<?php echo $this->escape($this->form->getMethod()) ?>" class="global_form">
    <div>
        <div>
            <h3>
                <?php echo $this->translate($this->form->getTitle()) ?>
            </h3>
            <p class="form-description"><?php //echo $this->translate($this->form->getDescription()) ?></p>
            <div class="form-elements">
                <?php if($this->form->getDecorator('FormErrors')) echo $this->form->getDecorator('FormErrors')->setElement($this->form)->render("");?>
                <?php if($this->form->getDecorator('FormMessages')) echo $this->form->getDecorator('FormMessages')->setElement($this->form)->render("");?> 
                
                <?php echo $this->form->title; ?>
                <?php echo $this->form->link; ?>
                <?php echo $this->form->country_id; ?>
                
                <div class="form-wrapper" id="image-wrapper"><div class="form-label" id="image-label"><label class="" for=""></label></div>
					<div class="form-element" id="image-element">
						<?php if($this->photo_url):?>
                        <div id="image" style="background-image: url(<?php echo $this->photo_url?>);: ;"></div>
                        <?php else:?>
                        <div id="image"></div>
                        <?php endif;?>
					</div>
				</div>
                
                <?php echo $this->form->image_upload; ?>
                <?php echo $this->form->file_id; ?>
                <?php echo $this->form->comp_id; ?>
                
                <?php echo $this->form->buttons; ?>
            </div>
         </div>
    </div>
</form> 
</div>               
<script type="text/javascript">

function cancelCreate(){
    var href = en4.core.baseUrl + 'admin/webmix/company';
    this.location.href = href;   
}
function openUploadform(){
    var href = en4.core.baseUrl + 'admin/webmix/company/upload';
    this.Smoothbox.open(href);        
}

function setPhoto($photo_url,$photo_id){
    //console.log($photo_url); 
    $('file_id').set('value',$photo_id);
    $('image').setStyle('background-image','url('+$photo_url+')');            
}

</script>